package com.tangruojie.service.impl;

import com.tangruojie.dao.AccountDao;
import com.tangruojie.service.AccountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @Transactional 注解应该加在实现类的方法上
 */
@Service
public class AccountServiceImpl implements AccountService {

    @Autowired
    private AccountDao accountDao;

    public void transfer(String out, String in, Double money) {
        accountDao.outMoney(out, money);
//        int i = 10 / 0;
        accountDao.inMoney(in, money);
    }

}
